/***
 * exportExcel(columns,list) 导出excel表格
 * columns Arrary=[{},{}]  表头 =[{title:'',key:''}]
 * list =[] table的数据 [{},{}]
 */
import { export_json_to_excel } from './ExportExcel'
export function exportExcel(columns,list,name){
    let tHeader = []
    let filterVal = []
    console.log(columns)
    if(!columns){
        return;
    }
    columns.forEach(item =>{
        tHeader.push(item.title)
        filterVal.push(item.key)
    })
    const data = list.map(v => filterVal.map(j => v[j]))
    export_json_to_excel(tHeader, data,name, columns);
}
